.class Lcom/youdao/note/task/TaskManager$14;
.super Lcom/youdao/note/task/network/PutNoteTask;
.source "TaskManager.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/youdao/note/task/TaskManager;->pushNote(Lcom/youdao/note/data/Note;Ljava/util/Map;)Z
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/youdao/note/task/TaskManager;

.field final synthetic val$note:Lcom/youdao/note/data/Note;

.field final synthetic val$noteMeta:Lcom/youdao/note/data/NoteMeta;


# direct methods
.method constructor <init>(Lcom/youdao/note/task/TaskManager;Lcom/youdao/note/data/Note;Ljava/util/Map;Lcom/youdao/note/data/NoteMeta;Lcom/youdao/note/data/Note;)V
    .locals 0
    .parameter
    .parameter "x0"
    .parameter
    .parameter
    .parameter

    .prologue
    .line 526
    .local p3, x1:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Lcom/youdao/note/data/resource/BaseResourceMeta;>;"
    iput-object p1, p0, Lcom/youdao/note/task/TaskManager$14;->this$0:Lcom/youdao/note/task/TaskManager;

    iput-object p4, p0, Lcom/youdao/note/task/TaskManager$14;->val$noteMeta:Lcom/youdao/note/data/NoteMeta;

    iput-object p5, p0, Lcom/youdao/note/task/TaskManager$14;->val$note:Lcom/youdao/note/data/Note;

    invoke-direct {p0, p2, p3}, Lcom/youdao/note/task/network/PutNoteTask;-><init>(Lcom/youdao/note/data/Note;Ljava/util/Map;)V

    return-void
.end method


# virtual methods
.method protected onFailed(Ljava/lang/Exception;)V
    .locals 5
    .parameter "e"

    .prologue
    const/16 v4, 0x10

    .line 536
    iget-object v1, p0, Lcom/youdao/note/task/TaskManager$14;->this$0:Lcom/youdao/note/task/TaskManager;

    #calls: Lcom/youdao/note/task/TaskManager;->checkError(Ljava/lang/Exception;)V
    invoke-static {v1, p1}, Lcom/youdao/note/task/TaskManager;->access$000(Lcom/youdao/note/task/TaskManager;Ljava/lang/Exception;)V

    .line 537
    instance-of v1, p1, Lcom/youdao/note/exceptions/ServerException;

    if-eqz v1, :cond_1

    move-object v0, p1

    .line 538
    check-cast v0, Lcom/youdao/note/exceptions/ServerException;

    .line 539
    .local v0, se:Lcom/youdao/note/exceptions/ServerException;
    invoke-virtual {v0}, Lcom/youdao/note/exceptions/ServerException;->getErrorCode()I

    move-result v1

    const/16 v2, 0xe1

    if-ne v1, v2, :cond_0

    .line 540
    iget-object v1, p0, Lcom/youdao/note/task/TaskManager$14;->this$0:Lcom/youdao/note/task/TaskManager;

    #getter for: Lcom/youdao/note/task/TaskManager;->mDataSource:Lcom/youdao/note/datasource/DataSource;
    invoke-static {v1}, Lcom/youdao/note/task/TaskManager;->access$100(Lcom/youdao/note/task/TaskManager;)Lcom/youdao/note/datasource/DataSource;

    move-result-object v1

    iget-object v2, p0, Lcom/youdao/note/task/TaskManager$14;->val$note:Lcom/youdao/note/data/Note;

    invoke-virtual {v2}, Lcom/youdao/note/data/Note;->getEntryPath()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/youdao/note/datasource/DataSource;->deleteNote(Ljava/lang/String;)Z

    .line 541
    invoke-virtual {p0}, Lcom/youdao/note/task/TaskManager$14;->clearError()V

    .line 542
    iget-object v1, p0, Lcom/youdao/note/task/TaskManager$14;->this$0:Lcom/youdao/note/task/TaskManager;

    const/4 v2, 0x0

    const/4 v3, 0x1

    invoke-virtual {v1, v4, v2, v3}, Lcom/youdao/note/task/TaskManager;->updateResult(ILcom/youdao/note/data/BaseData;Z)V

    .line 547
    .end local v0           #se:Lcom/youdao/note/exceptions/ServerException;
    :cond_0
    :goto_0
    return-void

    .line 545
    :cond_1
    iget-object v1, p0, Lcom/youdao/note/task/TaskManager$14;->this$0:Lcom/youdao/note/task/TaskManager;

    new-instance v2, Lcom/youdao/note/data/RemoteErrorData;

    invoke-direct {v2, p1}, Lcom/youdao/note/data/RemoteErrorData;-><init>(Ljava/lang/Exception;)V

    const/4 v3, 0x0

    invoke-virtual {v1, v4, v2, v3}, Lcom/youdao/note/task/TaskManager;->updateResult(ILcom/youdao/note/data/BaseData;Z)V

    goto :goto_0
.end method

.method public onSucceed(Ljava/lang/Integer;)V
    .locals 2
    .parameter "version"

    .prologue
    .line 529
    iget-object v0, p0, Lcom/youdao/note/task/TaskManager$14;->val$noteMeta:Lcom/youdao/note/data/NoteMeta;

    invoke-virtual {p1}, Ljava/lang/Integer;->intValue()I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/youdao/note/data/NoteMeta;->setVersion(I)V

    .line 530
    iget-object v0, p0, Lcom/youdao/note/task/TaskManager$14;->val$noteMeta:Lcom/youdao/note/data/NoteMeta;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/youdao/note/data/NoteMeta;->setDirty(Z)V

    .line 531
    iget-object v0, p0, Lcom/youdao/note/task/TaskManager$14;->this$0:Lcom/youdao/note/task/TaskManager;

    #getter for: Lcom/youdao/note/task/TaskManager;->mDataSource:Lcom/youdao/note/datasource/DataSource;
    invoke-static {v0}, Lcom/youdao/note/task/TaskManager;->access$100(Lcom/youdao/note/task/TaskManager;)Lcom/youdao/note/datasource/DataSource;

    move-result-object v0

    iget-object v1, p0, Lcom/youdao/note/task/TaskManager$14;->val$noteMeta:Lcom/youdao/note/data/NoteMeta;

    invoke-virtual {v0, v1}, Lcom/youdao/note/datasource/DataSource;->insertOrUpdateNoteMeta(Lcom/youdao/note/data/NoteMeta;)Z

    .line 532
    return-void
.end method

.method public bridge synthetic onSucceed(Ljava/lang/Object;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 526
    check-cast p1, Ljava/lang/Integer;

    .end local p1
    invoke-virtual {p0, p1}, Lcom/youdao/note/task/TaskManager$14;->onSucceed(Ljava/lang/Integer;)V

    return-void
.end method
